<?php
namespace app\admin\behavior;
// 记录用户的访问日志
use think\Db;
class ListenOperate
{
    public function run(&$params)
    {  
        $urls = lvConf('listenUrl'); 
        $request = request();
        $visit = strtolower($request->controller()."/".$request->action());//$request->module()."/". 
        $data = []; 
        if(isset($urls[$visit]))
        {
            $data['staff_id'] = session('admin_id');
            $data['operate_time'] = time();
            $data['operate_desc'] = $urls[$visit]['name'];
            $data['content'] = $visit;
            $data['operate_ip'] = $request->ip();  
            model('admin/LogOperates')->add($data);
        }
    }
}